package cn.sccdlg.springboot.controller;

import cn.sccdlg.springboot.domain.User;
import cn.sccdlg.springboot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/30 22:32
 * 用户Controller
 * 测试mybatis配置
 */
@Controller
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/queryUser")
    @ResponseBody
    public List<User> queryUser(){
        List<User> users = userMapper.queryUserList();
        System.out.println(users);
        return users;
    }
}
